<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.bootcss.com/vue/2.6.11/vue.min.js"></script>
    <script src="https://cdn.bootcss.com/vue-router/3.1.3/vue-router.min.js"></script>
</head>
<body>
<div id="app">
    <t1>
        <span>刘备</span>
        <span slot="slotA">关羽</span>
        <span slot="slotB">张飞</span>
        <template slot="slotC" slot-scope="slotValue">
            {{slotValue.data}}
        </template>
    </t1>
</div>

<template id="t1">
    <div>
        子组件：t1 <br>
        匿名插槽：
        <slot></slot>
        <br>
        具名插槽slotA：
        <slot name="slotA"></slot>
        <br>
        具名插槽slotB：
        <slot name="slotB"></slot>
        <br>
        作用域插槽slotC：
        <slot name="slotC" :data="list"></slot>
        <br>
    </div>
</template>

<script>
    let app = new Vue({
        "el": "#app",
        components: {
            t1: {
                template: "#t1",
                data() {
                    return {
                        list: ["赵云", "马超", "黄忠"]
                    }
                }
            }
        }
    });
</script>
</body>
</html>
